package com.wechat.common.web.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Knife4j接口文档配置
 *
 * @author wechat-team
 */
@Slf4j
@Configuration
public class Knife4jConfig {

    @Value("${spring.application.name:wechat-application}")
    private String applicationName;

    /**
     * 自定义OpenAPI
     */
    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title(applicationName + " API文档")
                        .description("wechat项目接口文档")
                        .version("1.0.0")
                        .contact(new Contact()
                                .name("jie")
                                .email("dev@wechat.com")));
    }
} 